import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export let useLangs = defineStore('langs', () => {

    let cur_lang = ref('zh');  //默认语言环境 缓存;

    let cur_lang_getter=computed(() => cur_lang.value);

    let menu=ref(1);

    let cur_menu_getter=computed(() => menu.value);

    function ch_cur_lang(datass){
        console.log("被调用",datass)
        cur_lang.value=datass
    }

    /*菜单改变*/
    function ch_menu(){
        menu.value=Math.random();
    }

    return {
        cur_lang_getter,
        ch_cur_lang,

        cur_menu_getter,
        ch_menu

    }
});
